#!/bin/bash
###
 # @Author: Logan.Li
 # @Gitee: https://gitee.com/attacker
 # @email: admin@attacker.club
 # @Date: 2025-03-02 22:25:32
 # @LastEditTime: 2025-03-02 22:25:34
 # @Description: 
### 

# 确保传入 S3 源桶
if [ -z "$1" ]; then
  echo "Usage: $0 <source-s3-bucket>"
  exit 1
fi

SOURCE_BUCKET=$1
LOCAL_DIR="/tmp/s3-download"

echo "🔽 下载 S3 Bucket: $SOURCE_BUCKET 到本地目录: $LOCAL_DIR"

# 创建目录
mkdir -p "$LOCAL_DIR"

# 执行 S3 同步下载
aws s3 sync "s3://$SOURCE_BUCKET" "$LOCAL_DIR"

echo "✅ 下载完成！"
